#ifndef LETTERSWIDGET_H
#define LETTERSWIDGET_H

#include <QWidget>
#include <QGSettings/qgsettings.h>
#include "kbbutton.h"
#include <QMap>

class LettersWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LettersWidget(QWidget *parent = nullptr);
    virtual ~LettersWidget();

    void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
    void changeFuncKeyStyle(QString obj, bool isLock);

public Q_SLOTS:
    void onBtnClicked(QChar charId);
    void onCapsChanged();

Q_SIGNALS:
    void clicked(int nKeyId);
    void specialBtnClicked(QString keyName);
    void normalBtnClicked(QChar c);


private slots:
    void onGlobalKeyRelease(const QString &key);

private:
    void initUI();
    void toggleCase();

private:
    QMap<KBButton*, QRect> m_mapBtnGeometrys;

    bool isShift = false;

    QGSettings *settings;
    bool capsState = false;
};

#endif // LETTERSWIDGET_H
